package acorn.other.model;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(name = "COMPANY", schema = "ACOPROG_LIY")
public class Company implements java.io.Serializable {

    /**
     * 送货公司ID
     */
    private Long companyid;
    /**
     * 送货公司类型
     */
    private String typeid;
    /**
     * 送货公司名称
     */
    private String name;
    /**
     * 送货公司地址
     */
    private String address;
    /**
     * 运费
     */
    private Long postfee;

    /**
     * 仓库ID
     */
    private Long warehouseId;


    @Id
    @Column(name = "COMPANYID")
    public Long getCompanyid() {
        return this.companyid;
    }

    public void setCompanyid(Long value) {
        this.companyid = value;
    }

    @Column(name = "TYPEID", length = 4)
    public String getTypeid() {
        return this.typeid;
    }

    public void setTypeid(String value) {
        this.typeid = value;
    }

    @Column(name = "NAME", length = 80)
    public String getName() {
        return this.name;
    }

    public void setName(String value) {
        this.name = value;
    }

    @Column(name = "ADDRESS", length = 120)
    public String getAddress() {
        return this.address;
    }

    public void setAddress(String value) {
        this.address = value;
    }

    @Column(name = "WAREHOUSEID")
    public Long getWarehouseId() {
        return warehouseId;
    }

    public void setWarehouseId(Long warehouseId) {
        this.warehouseId = warehouseId;
    }

    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("Companyid", getCompanyid())
                .append("Typeid", getTypeid())
                .append("Name", getName())
                .append("Address", getAddress())
                .append("WarehouseId", getWarehouseId())
                .toString();
    }

    public int hashCode() {
        return new HashCodeBuilder().toHashCode();
    }

    public boolean equals(Object obj) {
        if (obj instanceof Company == false) return false;
        if (this == obj) return true;
        Company other = (Company) obj;
        return new EqualsBuilder().isEquals();
    }
}

